How to express a polynomial in terms of Legendre's polynomials